import http from "@/http";
import type {
  AssignParm,
  PassWordModel,
  UserListParm,
  UserModel,
} from "./UserModel";
export const addApi = (data: UserModel) => {
  return http.post("/api/user/add", data);
};
export const getListApi = (parms: UserListParm) => {
  return http.get("/api/user/getList", parms);
};

export const getDetailApi = (userId: string) => {
  return http.get("/api/user/getRoleList", { userId: userId });
};
export const updateApi = (data: UserModel) => {
  return http.put("/api/user/update", data);
};
export const deleteApi = (id: string) => {
  return http.delete(`/api/user/${id}`);
};
export const resentPassWordApi = (data: UserModel) => {
  return http.post("/api/user/resetPassword", data);
};
export const getAssignTreeApi = (parm: AssignParm) => {
  return http.get("/api/user/getAssingTree", parm);
};
export const updatePasswordApi = (parm: PassWordModel) => {
  return http.post("/api/user/updataPassword", parm);
};
export const getUserInfoApi = (id: string) => {
  return http.get("/api/user/getInfo", { id: id });
};
